<?php
class SiteController extends Controller
{
	public function actionIndex() {
		if (isset($_POST['login-username']) && $_POST['login-username'] != '') {
			// sanitize
			if ($_POST['login-username'] == 'mateo') {
				$this->redirect('App');	
			}
		}
		$this->layout = 'basic';
		$this->render('login');
	}
	
	public function actionApp() {
		$this->layout = 'basic';
		$this->render('app');
	}
	
	public function actionError()
	{
		if($error=Yii::app()->errorHandler->error)
		{
			if(Yii::app()->request->isAjaxRequest)
				echo $error['message'];
			else
				$this->render('error', $error);
		}
	}
	public function actionLogout()
	{
	}
}